package com.lanmaoly.cunzheng;

import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

public class ByteArrayTest {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new ByteArrayInputStream("hello world".getBytes());
        ByteOutputStream bos = new ByteOutputStream();
        bos.write(inputStream);
        byte[] bytes = bos.toByteArray();
        inputStream.close();
        bos.close();
        System.out.println(new String(bytes));

        System.in.read("hkdsll".getBytes());
    }
}
